home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
t_os
/
gpen32k
/
source.exe
/
LIB
/
OSRC
/
SPRSAVE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-22
|
752b
|
38 lines
/***********************************************
システムスプライトセーバ
Copyright(C) 1993 Okome
***********************************************/
#include <stdio.h>
#include <string.h>
#include <EGB.h>
#include <normlib.h>
int sprsave( char *na, int xa, int ya )
{
int i, xb, yb;
char da[1024];
FILE *fp;
fp = fopen( na, "wb" );
fread( da, 1, 16, fp );
strcpy(da, "SPRITE");
WORD(da+6)=0;
WORD(da+8)=15;
WORD(da+10)=16;
WORD(da+12)=16;
WORD(da+14)=64;
fwrite( da, 1, 16, fp );
for ( i = 0; i < 64; i++ )
{
WORD(da) = i;
xb = i % 8;
yb = i / 8;
egbget( xa+16*xb, ya+16*yb,
xa+16*(xb+1)-1, ya+16*(yb+1)-1, &da[2] );
fwrite( da, 1, 16*16*2+2, fp );
}
fclose(fp);
return (0);
}